/*
 * This file is part of WebCL – JavaScript bindings for OpenCL
 * http://webcl.nokiaresearch.com/
 *
 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
 *
 * Contact: Jari Nikara  ;jari.nikara@nokia.com;
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * version 2.1 as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 *
 * The package is based on a published Khronos OpenCL 1.1 Specification,
 * see http://www.khronos.org/opencl/.
 *
 * OpenCL is a trademark of Apple Inc.
 */

/** \interface IWebCLEvent
 * IWebCLEvent interface abstracts a WebCL event.
 * \see cl_event
 */

#include "nsISupports.idl"
#include "nsISecurityCheckedComponent.idl"
#include "nsIVariant.idl"

#include "WebCL_types.idl"

[scriptable, uuid(cf7372e6-f2ec-467d-99dc-9eeb756bc3e3)]
interface IWebCLEvent : nsISecurityCheckedComponent
{
  /** Get event info.
   * \param aName Name of the info parameter.
   * \return The resulting value.
   * \see clGetEventInfo
   * \see WebCL_types
   */
  [implicit_jscontext]
  nsIVariant getEventInfo (in long aName);

  /** Get event profiling info.
   * \param aName Name of the info parameter.
   * \return The resulting value.
   * \see clGetEventProfilingInfo
   * \see WebCL_types
   */
  [implicit_jscontext]
  nsIVariant getEventProfilingInfo (in long aName);

  /** Sets the execution status of a user event object.
   * \param aExecutionStatus Specifies the new execution status to be set
   *  and can be CL_COMPLETE or a negative integer value to indicate
   *  an error. A negative integer value causes all enqueued commands that
   *  wait on this user event to be terminated. clSetUserEventStatus can
   *  only be called once to change the execution status of event.
   * \see clSetUserEventStatus
   */
  [implicit_jscontext]
  void setUserEventStatus (in long aExecutionStatus);

  /** Immediately releases all OpenCL-related resources if any are allocated
   * for this object. The object should not be used anymore after calling
   * this function.
   */
  void releaseCLResources ();
};
